import { _decorator, Component, profiler, Tween, Vec2 } from 'cc';
const { ccclass } = _decorator;
@ccclass('HelloWorld')
export class HelloWorld extends Component {
    protected onLoad() {
        profiler.hideStats();
        let bearNode = this.node.getChildByPath('1阶贝塞尔/Bear');
        let kunNode = this.node.getChildByPath('2阶贝塞尔/Kun');
        let ratNode = this.node.getChildByPath('3阶贝塞尔/Rat');
        this.schedule(() => {
            bearNode.setPosition(-300, 0);
            kunNode.setPosition(-300, 0);
            ratNode.setPosition(-300, 0);
            //1阶贝塞尔曲线
            // new Tween(bearNode).bezierTo(2, new Vec2(300, 0)).start();
            //2阶贝塞尔曲线
            new Tween(kunNode).bezierTo(2, new Vec2(130, 250), new Vec2(300, 0)).start();
            //3阶贝塞尔曲线
            // new Tween(ratNode).bezierTo(2, new Vec2(300, 350), new Vec2(-200, -350), new Vec2(300, 0)).start();
        }, 3, 1e8, 1e-4); //循环100000000次（相当于无限），延迟0.0001秒（相当于不延迟）
    }
}